1. Field of the Invention
The present invention relates to an NC device, and in particular, to a numerical control (NC) device capable of commanding a tool feed speed for machining a workpiece in accordance with an actual speed of a spindle motor.
2. Description of the Related Art
When executing thread cutting with an NC lathe, a tool feed speed to be commanded from an NC device is calculated on the basis of a rotational speed of a spindle motor transmitted from a position coder or the like, and a thread pitch width commanded by a program. Namely, in the NC device, assuming that a rotational speed of a spindle motor is S (rpm), and a pitch width of thread is P (mm), a tool feed speed command F (mm/s) is obtained by the following equation: EQU F=S.times.(1/60).times.P
Therefore, if the rotational speed S of the spindle motor is lowered in some degree, the tool feed speed is lowered in proportion to the rotational speed S. Generally, in the NC device, the workpiece can be machined in accordance with the tool feed speed which is commanded synchronously with the actual speed of spindle motor for rotating the workpiece, so that a pitch width commanded by a program can be always maintained in the thread cutting.
However, in the NC device, data is exchanged between the NC device and a servo side each time an interpolation signal ITP is generated. For this reason, a delay occurs in operations of signal input-output, and hence even if the rotational speed S of the spindle motor changes in a certain ITP cycle, the ITP cycle being specified by the NC device, it is difficult to create a command for changing the tool feed speed in such a manner that the command can follow the motor speed change. Further, when a great torque is suddenly applied to the spindle motor, e.g., at the beginning of thread cutting, the rotational speed is suddenly lowered. For this reason, when the workpiece is subject to thread cutting effected by the tool, an error occurs in a command value F for the tool feed speed at the moment the tool contacts with the workpiece, and therefore, the thread pitch width becomes large during the period where such an error is found.
As mentioned above, according to the conventional NC device, a delay time occurs in the tool feed speed command for machining the workpiece, and for this reason, there is a problem that machining accuracy for the workpiece is lowered.